/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbravo.data.loader.query;

import java.io.Serializable;


/**
 *
 * @author Administrator
 */
public class QBFParameter implements Serializable{
	
	public static QBFParameter ALL=new QBFParameter("",QBFCompareEnum.COMP_ALL,null);
	
	String fieldName;
    QBFCompareEnum qbf;
    Object value;
    //boolean notFlag;//not 标志位
    
    public QBFParameter(){
    	
    }
    
    public QBFParameter(String fieldName){
    	this.fieldName=fieldName;
    	qbf=QBFCompareEnum.COMP_NONE;
    }
    

    public QBFParameter(String fieldName,QBFCompareEnum qbf, Object value) {
    	this.fieldName=fieldName;
        this.qbf = qbf;
        this.value = value;
    }

    public QBFCompareEnum getQbf() {
        return qbf;
    }

    public void setQbf(QBFCompareEnum qbf) {
        this.qbf = qbf;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public QBFParameter isNull(){
		qbf=QBFCompareEnum.COMP_ISNULL;
		return this;
    }
    
    public QBFParameter isNotNull(){
    	qbf=QBFCompareEnum.COMP_ISNOTNULL;
    	return this;
    }
    
    public QBFParameter link(Object value){
    	qbf=QBFCompareEnum.COMP_RE;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter equal(Object value){
    	qbf=QBFCompareEnum.COMP_EQUALS;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter distanct(Object value){
    	qbf=QBFCompareEnum.COMP_DISTINCT;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter greater(Object value){
    	qbf=QBFCompareEnum.COMP_GREATER;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter less(Object value){
    	qbf=QBFCompareEnum.COMP_LESS;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter greaterOrEqual(Object value){
    	qbf=QBFCompareEnum.COMP_GREATEROREQUALS;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter lessOrEqual(Object value){
    	qbf=QBFCompareEnum.COMP_LESSOREQUALS;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter in(Object value){
    	qbf=QBFCompareEnum.COMP_IN;
    	this.value=value;
    	return this;
    }
    
    public QBFParameter clear(){
    	qbf=QBFCompareEnum.COMP_NONE;
    	this.value=null;
    	return this;
    }
    
    /*
    public QBFParameter not(){
    	this.notFlag=true;
    	return this;
    }*/
}
